package cn.tedu.boot11.controller;

import cn.tedu.boot11.entity.Text;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class bmiController {
    @RequestMapping("/bmi")
    @ResponseBody
    public  String bmi(float height, float weight  ){
        float bmi = weight/(height*height);
        System.out.println("bmi="+bmi);
        if (bmi<18.5){
            return "蛋蛋你瘦了";
        }
        if (bmi<24){
            return "恭喜你，体重正常";
        }
        if (bmi<28){
            return "蛋蛋你又肿了";
        }
        return "肿大了";
    }
}
